package org.study.es.boot.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;
import org.study.es.boot.entity.BookEntity;

/**
 * 接口关系：ElasticsearchRepository --> ElasticsearchCrudRepository --> PagingAndSortingRepository --> CrudRepository
 *
 * @author Administrator
 * @date 2021-12-31
 */
@Repository
public interface BookRepository extends ElasticsearchRepository<BookEntity, String> {
    //Optional<BookBean> findById(String id);

    Page<BookEntity> findByAuthor(String author, Pageable pageable);

    Page<BookEntity> findByTitle(String title, Pageable pageable);
}
